package echecs.init;


import echecs.vue.BoardVue;
import echecs.generateur.Generation;
import java.applet.*;
import java.awt.*;

public class LaunchEchecs extends Applet {
    //reference for the board classDie Referenz auf die KI

    BoardVue brain;
    //the elements of the GUI
    Button newgame = new Button("start new game");

//events
    @Override
    public boolean action(Event evt, Object arg) {
        if (((String) arg).equals("start new game")) {
            brain.newgame();
        }
        return true;
    }
//initialize the applet

    @Override
    public void init() {
        super.init();

        //initialize AI
        brain = new Generation(this);

        //build GUI
        setBackground(Color.lightGray);
        setLayout(new BorderLayout(10, 10));

        add("Center", brain);
        add("South", newgame);

        setSize(400, 400);
    }
//make a border with 10 bixels width

    @Override
    public Insets insets() {
        return new Insets(10, 10, 10, 10);
    }
}
